#ifndef ORDERFACTORY_H
#define ORDERFACTORY_H

#include "orderbase.h"
#include "pendingorder.h"
#include "normalorder.h"
#include "historyorder.h"

class OrderFactory
{
public:
    static NormalOrder* createBuyOrder (time_t time, const char *symbol, double openPrice, double lots, double stopLoss = 0, double takeProfit = 0, int magicNumber = 0);
    static NormalOrder* createSellOrder(time_t time, const char *symbol, double openPrice, double lots, double stopLoss = 0, double takeProfit = 0, int magicNumber = 0);
    static PendingOrder* createBuyLimitOrder (time_t time, const char *symbol, double price, double lots, double stopLoss = 0, double takeProfit = 0, int magicNumber = 0);
    static PendingOrder* createSellLimitOrder(time_t time, const char *symbol, double price, double lots, double stopLoss = 0, double takeProfit = 0, int magicNumber = 0);
    static HistoryOrder* createHistoryOrder(const char *strOrder);
    static HistoryOrder* createHistoryOrder(NormalOrder *normalOrder);
    static HistoryOrder* createHistoryOrder(PendingOrder *pendOrder);

private:
    static void changeOrderType(HistoryOrder *order, const char *strType);
};

#endif